<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The Swoole\Coroutine class</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="swoole-connection-iterator.valid.html">« Swoole\Connection\Iterator::valid</a></li>
      <li style="float: right;"><a href="swoole-coroutine.call-user-func-array.html">Swoole\Coroutine::call_user_func_array »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.swoole.html">Swoole</a></li>
    <li>The Swoole\Coroutine class</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="class.swoole-coroutine" class="reference">

 <h1 class="title">The Swoole\Coroutine class</h1>
 

 <div class="partintro"><p class="verinfo">(PECL swoole &gt;= 2.0.0)</p>


  <div class="section" id="swoole-coroutine.intro">
   <h2 class="title">简介</h2>
   <p class="para">

   </p>
  </div>


  <div class="section" id="swoole-coroutine.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">class</span> <strong class="classname">Swoole\Coroutine</strong>
     </span>
     {</div>

    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="swoole-coroutine.call-user-func-array.html" class="methodname">call_user_func_array</a></span>(<span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$callback</code></span>, <span class="methodparam"><span class="type">array</span> <code class="parameter">$param_array</code></span>): <span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="swoole-coroutine.call-user-func.html" class="methodname">call_user_func</a></span>(<span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$callback</code></span>, <span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter">...$args</code></span>): <span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="swoole-coroutine.cli-wait.html" class="methodname">cli_wait</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="swoole-coroutine.create.html" class="methodname">create</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-client.close.html" class="methodname">Swoole\Coroutine\Client::close</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-client.connect.html" class="methodname">Swoole\Coroutine\Client::connect</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-client.destruct.html" class="methodname">Swoole\Coroutine\Client::__destruct</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-client.getpeername.html" class="methodname">Swoole\Coroutine\Client::getpeername</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-client.getsockname.html" class="methodname">Swoole\Coroutine\Client::getsockname</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-client.isconnected.html" class="methodname">Swoole\Coroutine\Client::isConnected</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-client.recv.html" class="methodname">Swoole\Coroutine\Client::recv</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-client.send.html" class="methodname">Swoole\Coroutine\Client::send</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-client.sendfile.html" class="methodname">Swoole\Coroutine\Client::sendfile</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-client.sendto.html" class="methodname">Swoole\Coroutine\Client::sendto</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-client.set.html" class="methodname">Swoole\Coroutine\Client::set</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-http-client.addfile.html" class="methodname">Swoole\Coroutine\Http\Client::addFile</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-http-client.close.html" class="methodname">Swoole\Coroutine\Http\Client::close</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-http-client.destruct.html" class="methodname">Swoole\Coroutine\Http\Client::__destruct</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-http-client.execute.html" class="methodname">Swoole\Coroutine\Http\Client::execute</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-http-client.get.html" class="methodname">Swoole\Coroutine\Http\Client::get</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-http-client.getdefer.html" class="methodname">Swoole\Coroutine\Http\Client::getDefer</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-http-client.isconnected.html" class="methodname">Swoole\Coroutine\Http\Client::isConnected</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-http-client.post.html" class="methodname">Swoole\Coroutine\Http\Client::post</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-http-client.recv.html" class="methodname">Swoole\Coroutine\Http\Client::recv</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-http-client.set.html" class="methodname">Swoole\Coroutine\Http\Client::set</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-http-client.setcookies.html" class="methodname">Swoole\Coroutine\Http\Client::setCookies</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-http-client.setdata.html" class="methodname">Swoole\Coroutine\Http\Client::setData</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-http-client.setdefer.html" class="methodname">Swoole\Coroutine\Http\Client::setDefer</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-http-client.setheaders.html" class="methodname">Swoole\Coroutine\Http\Client::setHeaders</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-http-client.setmethod.html" class="methodname">Swoole\Coroutine\Http\Client::setMethod</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-mysql.close.html" class="methodname">Swoole\Coroutine\MySQL::close</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-mysql.connect.html" class="methodname">Swoole\Coroutine\MySQL::connect</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-mysql.destruct.html" class="methodname">Swoole\Coroutine\MySQL::__destruct</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-mysql.getdefer.html" class="methodname">Swoole\Coroutine\MySQL::getDefer</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-mysql.query.html" class="methodname">Swoole\Coroutine\MySQL::query</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-mysql.recv.html" class="methodname">Swoole\Coroutine\MySQL::recv</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="swoole-coroutine-mysql.setdefer.html" class="methodname">Swoole\Coroutine\MySQL::setDefer</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="swoole-coroutine.getuid.html" class="methodname">getuid</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="swoole-coroutine.resume.html" class="methodname">resume</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="swoole-coroutine.suspend.html" class="methodname">suspend</a></span>(): <span class="type"><span class="type ReturnType">ReturnType</span></span></div>

   }</div>


  </div>

 </div>

 


















































































































































































































































































































<h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="swoole-coroutine.call-user-func-array.html">Swoole\Coroutine::call_user_func_array</a> — Call a callback with an array of parameters</li><li><a href="swoole-coroutine.call-user-func.html">Swoole\Coroutine::call_user_func</a> — Call a callback given by the first parameter</li><li><a href="swoole-coroutine.cli-wait.html">Swoole\Coroutine::cli_wait</a> — Description</li><li><a href="swoole-coroutine.create.html">Swoole\Coroutine::create</a> — Description</li><li><a href="swoole-coroutine-client.close.html">Swoole\Coroutine\Client::close</a> — Description</li><li><a href="swoole-coroutine-client.connect.html">Swoole\Coroutine\Client::connect</a> — Description</li><li><a href="swoole-coroutine-client.construct.html">Swoole\Coroutine\Client::__construct</a> — Description</li><li><a href="swoole-coroutine-client.destruct.html">Swoole\Coroutine\Client::__destruct</a> — Description</li><li><a href="swoole-coroutine-client.getpeername.html">Swoole\Coroutine\Client::getpeername</a> — Description</li><li><a href="swoole-coroutine-client.getsockname.html">Swoole\Coroutine\Client::getsockname</a> — Description</li><li><a href="swoole-coroutine-client.isconnected.html">Swoole\Coroutine\Client::isConnected</a> — Description</li><li><a href="swoole-coroutine-client.recv.html">Swoole\Coroutine\Client::recv</a> — Description</li><li><a href="swoole-coroutine-client.send.html">Swoole\Coroutine\Client::send</a> — Description</li><li><a href="swoole-coroutine-client.sendfile.html">Swoole\Coroutine\Client::sendfile</a> — Description</li><li><a href="swoole-coroutine-client.sendto.html">Swoole\Coroutine\Client::sendto</a> — Description</li><li><a href="swoole-coroutine-client.set.html">Swoole\Coroutine\Client::set</a> — Description</li><li><a href="swoole-coroutine-http-client.addfile.html">Swoole\Coroutine\Http\Client::addFile</a> — Description</li><li><a href="swoole-coroutine-http-client.close.html">Swoole\Coroutine\Http\Client::close</a> — Description</li><li><a href="swoole-coroutine-http-client.construct.html">Swoole\Coroutine\Http\Client::__construct</a> — Description</li><li><a href="swoole-coroutine-http-client.destruct.html">Swoole\Coroutine\Http\Client::__destruct</a> — Description</li><li><a href="swoole-coroutine-http-client.execute.html">Swoole\Coroutine\Http\Client::execute</a> — Description</li><li><a href="swoole-coroutine-http-client.get.html">Swoole\Coroutine\Http\Client::get</a> — Description</li><li><a href="swoole-coroutine-http-client.getdefer.html">Swoole\Coroutine\Http\Client::getDefer</a> — Description</li><li><a href="swoole-coroutine-http-client.isconnected.html">Swoole\Coroutine\Http\Client::isConnected</a> — Description</li><li><a href="swoole-coroutine-http-client.post.html">Swoole\Coroutine\Http\Client::post</a> — Description</li><li><a href="swoole-coroutine-http-client.recv.html">Swoole\Coroutine\Http\Client::recv</a> — Description</li><li><a href="swoole-coroutine-http-client.set.html">Swoole\Coroutine\Http\Client::set</a> — Description</li><li><a href="swoole-coroutine-http-client.setcookies.html">Swoole\Coroutine\Http\Client::setCookies</a> — Description</li><li><a href="swoole-coroutine-http-client.setdata.html">Swoole\Coroutine\Http\Client::setData</a> — Description</li><li><a href="swoole-coroutine-http-client.setdefer.html">Swoole\Coroutine\Http\Client::setDefer</a> — Description</li><li><a href="swoole-coroutine-http-client.setheaders.html">Swoole\Coroutine\Http\Client::setHeaders</a> — Description</li><li><a href="swoole-coroutine-http-client.setmethod.html">Swoole\Coroutine\Http\Client::setMethod</a> — Description</li><li><a href="swoole-coroutine-mysql.close.html">Swoole\Coroutine\MySQL::close</a> — Description</li><li><a href="swoole-coroutine-mysql.connect.html">Swoole\Coroutine\MySQL::connect</a> — Description</li><li><a href="swoole-coroutine-mysql.construct.html">Swoole\Coroutine\MySQL::__construct</a> — Description</li><li><a href="swoole-coroutine-mysql.destruct.html">Swoole\Coroutine\MySQL::__destruct</a> — Description</li><li><a href="swoole-coroutine-mysql.getdefer.html">Swoole\Coroutine\MySQL::getDefer</a> — Description</li><li><a href="swoole-coroutine-mysql.query.html">Swoole\Coroutine\MySQL::query</a> — Description</li><li><a href="swoole-coroutine-mysql.recv.html">Swoole\Coroutine\MySQL::recv</a> — Description</li><li><a href="swoole-coroutine-mysql.setdefer.html">Swoole\Coroutine\MySQL::setDefer</a> — Description</li><li><a href="swoole-coroutine.getuid.html">Swoole\Coroutine::getuid</a> — Description</li><li><a href="swoole-coroutine.resume.html">Swoole\Coroutine::resume</a> — Description</li><li><a href="swoole-coroutine.suspend.html">Swoole\Coroutine::suspend</a> — Description</li></ul>
</div>
</div></div></body></html>